<section class="sidebar-box">
    <section class="sidebar-nav">
        <section class="sidebar-title">
            <p>193计网502</p>
        </section>
        <ul>
            <li class="home-page">
                <section class="nav-icon"></section>
                <section class="nav-text">首页</section>
            </li>
            <li class="search">
                <section class="nav-icon"></section>
                <section class="nav-text">搜索</section>
            </li>
            <li class="my">
                <section class="nav-icon"></section>
                <section class="nav-text">个人</section>
            </li>
        </ul>
        <section class="contact-us">
            <section class="contact-us-title"><p>联系我们</p></section>
            <section class="contact-us-email"><p>yjxst@icloud.com</p></section>
        </section>
    </section>
</section>

<script src="../../../assets/js/jQuery.js"></script>
<script>
    var href = window.location.href,
        admin = localStorage.getItem('admin')

    //判断当前页面
    if (href === 'http://119.23.46.241/pages/homePage.html') {
        $(".nav-icon").eq(0).css('background', 'url("https://19jwshow.oss-cn-shenzhen.aliyuncs.com/images/homePageOld.png")').parent().addClass("focus")
    }
    if (href === 'http://119.23.46.241/pages/searchPage.html') {
        $(".nav-icon").eq(1).css('background', 'url("https://19jwshow.oss-cn-shenzhen.aliyuncs.com/images/searchOld.png")').parent().addClass("focus")
    }
    if (href === 'http://119.23.46.241/pages/personalPage.html') {
        $(".nav-icon").eq(2).css('background', 'url("https://19jwshow.oss-cn-shenzhen.aliyuncs.com/images/myOld.png")').parent().addClass("focus")
    }
    if (href === 'http://119.23.46.241/pages/administratorPersonalPage.html') {
        $(".nav-icon").eq(2).css('background', 'url("https://19jwshow.oss-cn-shenzhen.aliyuncs.com/images/myOld.png")').parent().addClass("focus")
    }


    if (href === 'http://193jwshow.top/pages/homePage.html') {
        $(".nav-icon").eq(0).css('background', 'url("https://19jwshow.oss-cn-shenzhen.aliyuncs.com/images/homePageOld.png")').parent().addClass("focus")
    }
    if (href === 'http://193jwshow.top/pages/searchPage.html') {
        $(".nav-icon").eq(1).css('background', 'url("https://19jwshow.oss-cn-shenzhen.aliyuncs.com/images/searchOld.png")').parent().addClass("focus")
    }
    if (href === 'http://193jwshow.top/pages/personalPage.html') {
        $(".nav-icon").eq(2).css('background', 'url("https://19jwshow.oss-cn-shenzhen.aliyuncs.com/images/myOld.png")').parent().addClass("focus")
    }
    if (href === 'http://193jwshow.top/pages/administratorPersonalPage.html') {
        $(".nav-icon").eq(2).css('background', 'url("https://19jwshow.oss-cn-shenzhen.aliyuncs.com/images/myOld.png")').parent().addClass("focus")
    }



    //点击侧边导航栏按钮跳转
    $(".home-page").on('click', function () {
        window.location.href = 'homePage.html'
    })
    $(".search").on('click', function () {
        window.location.href = 'searchPage.html'
    })
    $(".my").on('click', function () {
        if (admin == 1) {
            window.location.href = 'administratorPersonalPage.html'
        }
        if (admin == 0) {
            window.location.href = 'personalPage.html'
        }
        if (!admin) {
            window.location.href = 'personalPage.html'
        }

    })
</script>